/**
*  
* @Function ES分页入参 
* @ProjectName credit-framework-common 
* @PackageName com.py.credit.utils.elasticsearch    
* @FileName EsPageEntity.java    
* @Date 2018年11月9日下午2:32:04
* @Author Min DongXv
* @Copyright (c) 2018, 金电联行 All Rights Reserved.   
*   
*/
package com.py.credit.utils.elasticsearch;

import java.io.Serializable;
import java.util.List;

/**
 * 
 * @Function ES分页入参
 * @ClassName EsPageEntity
 * @Date 2018年11月9日 下午2:32:04
 * @Author Min DongXv
 * 
 */
public class EsPage implements Serializable {

	private static final long serialVersionUID = 3306315284245336687L;

	public static final int DEFAULT_PAGE_SIZE = 20;
	// -- 公共变量 --//
	public static final String ASC = "asc";
	public static final String DESC = "desc";

	// 每页显示个数
	private int limit;

	private int totalCount;
	// 当前页 从1开始
	private int page;
	// 排序 需要排序的字段(非时间，数值字段排序操作需要开启Fielddata,需要进行映射修改，默认不开启，传null)
	private List<EsPageSortEntity> sorts;

	public EsPage() {
		this.page = 1;
		this.limit = DEFAULT_PAGE_SIZE;
	}

	/**
	 * @return the limit
	 */
	public int getLimit() {
		return limit;
	}

	/**
	 * @param limit
	 *            the limit to set
	 */
	public void setLimit(int limit) {
		this.limit = limit;
	}

	/**
	 * @return the page
	 */
	public int getPage() {
		return page;
	}

	/**
	 * @param page
	 *            the page to set
	 */
	public void setPage(int page) {
		this.page = page;
	}

	@Override
	public String toString() {
		return "EsPage [limit=" + limit + ", page=" + page + ", sorts=" + sorts + "]";
	}

	/**
	 * @return the sorts
	 */
	public List<EsPageSortEntity> getSorts() {
		return sorts;
	}

	/**
	 * @param sorts
	 *            the sorts to set
	 */
	public void setSorts(List<EsPageSortEntity> sorts) {
		this.sorts = sorts;
	}

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}

}
